import math

// V's model of concurrency is going to be very simelar to Go's
// for now, `go foo()` run `foo()` concurrently in different thread
// `wait()` method waits until a parallel thread has finished
// In V 0.4, `go foo()` will be automatically renamed via vfmt to `spawn foo()`
// there will be a way to launch a coroutine, which is a lightweight thread managed by the runtime

// ordinary function without return value
fn p(a f64, b f64) {
	c := math.sqrt(a * a + b * b)
	println(c)
}

fn main() {
	h := go p(3, 4)
	// p() runs in parallel thread
	h.wait()
	// p() has definitely finished
}
